using System;
using System.Xml;
using System.Xml.Serialization;
using System.Runtime.Serialization;
using System.Collections.Generic;

namespace GalaxyZoo.Client.Model
{
    [DataContract]
    [XmlType(AnonymousType = true)]
    [XmlRoot(IsNullable = false, ElementName="user", Namespace="")]
    public class User : AbstractGalaxyZooObject
    {
        /// <summary>
        /// Gets/Set the Id property.
        /// </summary>
        [DataMember]
        [XmlElement(ElementName="id")]
        public int Id { get; set; }

        /// <summary>
        /// Gets/Set the Login property.
        /// </summary>
        [DataMember]
        [XmlElement(ElementName="login")]
        public string Login { get; set; }

        /// <summary>
        /// Gets/Set the Name property.
        /// </summary>
        [DataMember]
        [XmlElement(ElementName="name")]
        public string Name { get; set; }

        /// <summary>
        /// Gets/Set the Email property.
        /// </summary>
        [DataMember]
        [XmlElement(ElementName="email")]
        public string Email { get; set; }

        /// <summary>
        /// Gets/Set the Joined property.
        /// </summary>
        [DataMember]
        [XmlIgnore()]
        public DateTime? Joined { get; set; }

        /// <summary>
        /// This property is use for Serializing and Deserializing DateTime and
        /// should not be used as part of the API.
        /// </summary>
        [XmlElement(ElementName="joined")]
        public string Joined_Internal
        {
            get { return base.FromDateTime(this.Joined); }
            set { this.Joined = base.ToDateTime(value); }
        }

        /// <summary>
        /// Gets/Set the Classifications property.
        /// </summary>
        [DataMember]
        [XmlElement(ElementName="classifications")]
        public int Classifications { get; set; }

        /// <summary>
        /// Gets/Set the LastActive property.
        /// </summary>
        [DataMember]
        [XmlIgnore()]
        public DateTime? LastActive { get; set; }

        /// <summary>
        /// This property is use for Serializing and Deserializing DateTime and
        /// should not be used as part of the API.
        /// </summary>
        [XmlElement(ElementName="last_active")]
        public string LastActive_Internal
        {
            get { return base.FromDateTime(this.LastActive); }
            set { this.LastActive = base.ToDateTime(value); }
        }

        /// <summary>
        /// Gets/Set the LastClassified property.
        /// </summary>
        [DataMember]
        [XmlElement(ElementName="last_classified")]
        public int LastClassified { get; set; }
    }
}
